export const mixin={
	data(){
		return{
			
		}
	},
	methods:{
		saveImageMixin(filePath) {
			return new Promise((resolve,reject)=>{
				uni.getSetting({
					complete(res) {
						console.log(res);
					}
				})
				uni.saveImageToPhotosAlbum({
					filePath: filePath,
					success(res) {
						resolve(200);
					},
					fail(err) {
						if (err.errMsg === "saveImageToPhotosAlbum:fail:auth denied" || err.errMsg ==="saveImageToPhotosAlbum:fail auth deny" || err.errMsg === "saveImageToPhotosAlbum:fail authorize no response") {
							wx.showModal({
								message: '提示',
								content: '需要您授权保存相册',
								showCancel: false,
								success: modalSuccess => {
									wx.openSetting({
										success(settingdata) {
											if (settingdata.authSetting['scope.writePhotosAlbum']) {
												resolve(201);
											} else {
												reject(202);
											}
										}
									})
								}
							})
						}
					}
				})
			});
		},
	}
}